<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:h="http://java.sun.com/jsf/html"
   template="/WEB-INF/templates/default.xhtml">
   <ui:define name="content">
      
      <h2>Chuck Norris Facts</h2>
      
      <h:form id="fact">
	      <h:inputText id="name" value="#{newFact.fact}" />
			<h:commandButton id="addfact"
			  action="#{chuckNorrisBean.addFact}" value="Add Fact" />
	      
	      <h:dataTable var="_fact" value="#{chuckNorrisBean.facts}">
	         <h:column>
	            <f:facet name="header">Fact</f:facet>
	            #{_fact.fact}
	         </h:column>
	
	      </h:dataTable>
	      
	       <h:commandButton action="randomnorris?faces-redirect=true" value="Randomize" />
      </h:form>
   </ui:define>
</ui:composition>
